#ifndef ENVELOPE_H
#define ENVELOPE_H

class Envelope
{
public:
	virtual void Clip(float* value, float, float) = 0;

};

class LinearDecayEnv
{
public:
	void Clip(float* value, float gradient, float yIntercept, float xVal)
	{
		// y = mx + b
		float ampScaler = (gradient* xVal) + yIntercept;
		*value *= ampScaler;
	}
};

/*
class FreqDurationEnv : public Envelope
{
	FreqDurationEnv(float minDuration, float maxDuration, float maxFreq, float minFreq, float midFreq)
		: m_minDuration(minDuration), m_maxDuration(maxDuration), m_maxFreq(maxFreq), m_minFreq(minFreq), m_midFreq(midFreq)
	{ }
	void Clip(float* value, float freq, float)
	{
		m_decay.Clip(value, 0, 1);
		float min = *value;

	}

private:
	LinearDecayEnv m_decay;

	float m_maxDuration;
	float m_minDuration;
	float m_maxFreq;
	float m_minFreq;
	float m_midFreq;
};
*/

#endif